<?php
include_once("../common.php");

$id = $_SESSION['idusers'];
if(isset($_GET['id']))
	$id = $_GET['id'];
	
if(!isAdmin($_SESSION['username']) && $_SESSION['idusers'] != $id)
	exit(0);

if(isset($_GET['shid']) && isset($_GET['state'])){
	$c = connect();
	if($_GET['state'] == true){
		mysql_query("INSERT INTO interest (shid, users_idusers) 
			VALUES ('".$_GET['shid']."','".$id."')");
	}
	else
		mysql_query("DELETE FROM interest WHERE shid = '".$_GET['shid']." AND users_idusers = '".$id."'");
	mysq_close($c);
}
?>
